package jp.java.test1.pkg10_19.test18;

enum Item {
	APPLE(1) {
		private String name = "りんご";
		public String toString() {
			return name;
		}
	},
	BANANA(2) {
		private String name = "ばなな";
		public String toString() {
			return name;
		}
		public String test() {
			return name;
		}
	},
	TEST(3)
	;
	
	private int price;
	Item(int price) {
		this.price = price;
	}
	
	public int getPrice() {
		return this.price;
	}
	public String test() {
		return "test";
	}
}
public class Main {

	public static void main(String[] args) {
//		System.out.println(Item.APPLE);
		Item [] items = Item.values();
		for(Item item : items) {
//			if (item == item.APPLE) {
				System.out.println(item + ":" + item.getPrice() + item.test());
//			}
		}
//		Item item = Item.valueOf("ばなな");
//		System.out.println(item + ":" + item.getPrice() + item.test());
	}

}
